<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['namespace' => 'API', 'prefix' => 'auth'], function () {
    Route::post('login', 'AuthController@login');
});
Route::group(['namespace' => 'API', 'prefix' => 'property'], function () {
    Route::resource('property', 'PropertyController');
});
Route::group(['namespace' => 'API', 'middleware' => ['auth:api']], function () {

    //获取当前登录人的个人信息
    Route::get('admin/profile', 'AdminController@getProfile');
    Route::post('admin/profile', 'AdminController@updateProfile');
    Route::post('admin/reset-password/{id}', 'AdminController@resetPassword');
    Route::resource('admin', 'AdminController');
    Route::resource('permissions', 'RoleController');
    Route::group(['prefix' => 'data'], function () {
        Route::get('organization-list', 'DataProviderController@organizationList');
        Route::get('mediator-list', 'DataProviderController@mediatorList');
        Route::get('permission-list', 'DataProviderController@permissionList');
    });
});
